'''http://www.jrj.com.cn/'''
import json


def statisticsMinutes():
    """涨跌停1分钟数据统计"""

    data = {}

    # 构造URL请求、user-agent头文件
    url = 'http://homeflashdata2.jrj.com.cn/limitStatistic/min_and_concept.js'
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0'}

    import requests
    session = requests.Session()
    # 禁用安全请求警告
    from urllib3.exceptions import InsecureRequestWarning
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
    # dicts = {}
    try:
        html = session.get(url=url, data=data, headers=headers, verify=False).text
    except Exception as spider_error:
        print("涨跌停1分钟数据统计 html抓取过程报错，错误信息为：%s" % spider_error)
        return None
    return html


def statisticsLastMinutes(file):
    """读取本地保存的上个交易日 涨跌停1分钟数据统计"""
    # 打开文件
    fo = open(file, "r", encoding='utf-8')
    lines = ''

    for line in fo.readlines():  # 依次读取每行
        lines += line.strip()  # 去掉每行头尾空白

    # 关闭文件
    fo.close()
    return lines


if __name__ == '__main__':
    print(statisticsMinutes())
    # print(wencai_search('当日涨幅大于0'))
